package com.zf.museum.config;



import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

@Configuration
@ComponentScan
public class WebConfig extends WebMvcConfigurerAdapter{

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {

        registry.addResourceHandler("/museum/**")
                .addResourceLocations("file:d:/museum/picture/");

        registry.addResourceHandler("/**")
                .addResourceLocations("classpath:/templates/");

        registry.addResourceHandler("/static/**")
                .addResourceLocations("classpath:/static/");

        super.addResourceHandlers(registry);
    }
}
